翻訳と辞書
Words near each other
・ Erased Tapes Records
・ Eraser
・ Eraser (album)
・ Eraser (disambiguation)
・ Eraser (film)
・ Eraser (song)
・ Eraser Children
・ Eraser Cut
・ Eraser vs Yöjalka
・ Eraserhead
・ Eraserheads
・ Eraserheads Anthology
・ Eraserheads Anthology Two
・ Eraserheads discography
・ Erasermate
Erase–remove idiom
・ Erasing David
・ Erasing Hate
・ Erasing rule
・ Erasing Sherlock
・ Erasing the Goblin
・ Erasinus
・ Erasistratus
・ Erasistratus Discovering the Cause of Antiochus' Disease
・ Erasme Louis Surlet de Chokier
・ Erasmia
・ Erasmio
・ Erasmo
・ Erasmo Carlos
・ Erasmo Catarino


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Erase–remove idiom : ウィキペディア英語版
Erase–remove idiom
The erase–remove idiom is a common C++ technique to eliminate elements that fulfill a certain criterion from a C++ Standard Library container.〔
〕〔
〕〔C/C++ Users Journal, October 2001. (''STL Algorithms vs. Hand-Written Loops'' )〕
== Motivation ==

A common programming task is to remove all elements that have a certain value or fulfill a certain criterion from a collection. In C++, this could be achieved using a hand-written loop. It is, however, preferred to use an algorithm from the C++ Standard Library for such tasks.〔〔〔
The algorithm library provides the remove and remove_if algorithms for this. Because these algorithms operate on a range of elements denoted by two forward iterators, they have no knowledge of the underlying container or collection.〔 Thus, no elements are actually removed from the container. Rather, all elements which don't fit the remove criteria are brought together to the front of the range, in the same relative order. The remaining elements are left in a valid, but unspecified, state. When this is done, remove returns an iterator pointing one element past the last unremoved element.〔〔

To actually eliminate elements from the container, remove is combined with the container's erase member function, hence the name "erase–remove idiom".

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Erase–remove idiom」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.